import java.io.*;

public class Demo5 {
    public static void main(String[] args) throws IOException {
        String path = "D:/Test/test.txt";
        try(Writer writer = new FileWriter(path)){
            //写文件
        }
    }
}
